package com.candy.bean;

import com.candy.bean.Team;

public class Student {
    String name;
    int stuNo;
    boolean stuSex;


    public Student() {
    }

    public Student(String name, int stuNo, boolean stuSex) {
        this.name = name;
        this.stuNo = stuNo;
        this.stuSex = stuSex;
    }

    //    成员内部类
    public class Game{
        public void playGame(){
            System.out.println("我是成员内部类");
        }
    }
    public static class Sleep{
        public void sleepping(){
            System.out.println("我是静态内部类");
        }
    }

    public void  sayHi(){
        System.out.println("大家好");
        Game g1=new Game();
        g1.playGame();
    }
    public void sayBye(){
        class Score{
            public void  getScore(){
                System.out.println("我是局部内部类");
            }
        }

        Score s=new Score();
        s.getScore();
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", stuNo=" + stuNo +
                ", stuSex=" + stuSex +
                '}';
    }

    public void sayHello(){
        System.out.println("sayHello");
//        匿名内部类
        new Team(){
            @Override
            public void playGameByTeam() {
                System.out.println("匿名内部类");
                System.out.println("王者荣耀5V5");

            }
        }.playGameByTeam();
    }












}
